<?php
/**
 * Created by PhpStorm.
 * User: v_shiyanjun
 * Date: 2018/12/28
 * Time: 下午2:42
 */
//实例化redis对象
$redis = new redis();
//连接redis,第一个参数是redis服务的IP127.0.0.1是自己的,6379是端口号
$redis->connect('127.0.0.1', 6379);
echo "Server is running: " . $redis->ping();